<template>
  <div>
    <ul class="nav">
      <li v-for="item of word" :key="item.id" @click="handleClick">{{item}}</li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "CityWord",
  props: {
    word: {
      type: Array
    }
  },
  methods: {
    handleClick(event){
      this.$emit("changeWord",event.target.innerText);
    }
  },
};
</script>
<style lang="scss" scoped>
.nav {
  position: fixed;
  width: 50px;
  right: 0;
  top: 200px;
  color: rgb(2, 188, 213);
  li {
    text-align: center;
    line-height: 50px;
  }
}
</style>
